package com.block.datapush.service.apipush;

import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.block.common.enums.BaseTypeInfoEnum;
import com.block.common.enums.ProfitSharingEnum;
import com.block.common.model.dto.ThirdInfoDTO;
import com.block.common.model.param.PushApiKeyParam;
import com.block.common.service.IApplicationInfoService;
import com.block.common.service.LogFactory;
import com.block.common.service.merchant.IMerchantThirdBaseInfoService;
import com.block.datapush.enums.PushStatusEnum;
import com.block.datapush.model.PushQueryParam;
import com.block.datapush.model.dto.NoticeParamDTO;
import com.block.datapush.model.result.ProtocolParamResult;
import com.block.datapush.model.result.PushApiResult;
import com.block.datapush.model.result.StarInfoResult;
import com.block.datapush.service.IPushApi2Service;
import com.block.datapush.service.IPushApiService;
import com.block.datapush.service.IPushExtHandleService;
import com.block.datapush.service.apipush.utils.JiKeApisUtil;
import com.block.datapush.service.apipush.utils.MobileMd5IsInListUtils;
import com.block.db.entity.ApplicationInfo;
import com.block.db.entity.MemberSourceInfo;
import com.block.db.entity.MerchantBaseInfo;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.time.format.DateTimeFormatter;
import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

/**
 * apib 撞库返回授权地址
 * 通知进件
 *
 */
@Service
public class JiKeApiSMaskPushService implements IPushApiService, IPushExtHandleService, IPushApi2Service {

    private static final Logger log = LogFactory.getPushLog();

    @Autowired
    IApplicationInfoService applicationInfoService;
    @Autowired
    IMerchantThirdBaseInfoService merchantThirdBaseInfoService;

    @Override
    public PushApiResult checkUser(String orderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {

        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);
        Map<String, Object> paramMap = new HashMap<>();

        paramMap.put("phone", memberSourceInfo.getMobile().substring(0,8));
        paramMap.put("nameMd5", SecureUtil.md5(memberSourceInfo.getRealname()));
        if (memberSourceInfo.getSex() == 1){
            paramMap.put("sex", 1);
        }else {
            paramMap.put("sex", 0);
        }
        paramMap.put("age",memberSourceInfo.getAge());
        paramMap.put("cityName",memberSourceInfo.getCity());
        paramMap.put("loanAmount", JiKeApisUtil.getloan(memberSourceInfo.getLoanAmount()));
        paramMap.put("loanTerm", JiKeApisUtil.getLoanTime(memberSourceInfo.getLoanTime()));
        paramMap.put("salaryType", "2");
        paramMap.put("socialSecurity",JiKeApisUtil.getSocialInsurance(memberSourceInfo.getShebao()));
        paramMap.put("estate",JiKeApisUtil.getHouse(memberSourceInfo.getHouse()));
        paramMap.put("lifeInsurance",JiKeApisUtil.getbaodan(memberSourceInfo.getBaoxian()));
        paramMap.put("degree",JiKeApisUtil.getXueli(memberSourceInfo.getXueli()));
        paramMap.put("car",JiKeApisUtil.getCar(memberSourceInfo.getCar()));
        paramMap.put("monthIncome",JiKeApisUtil.getShouRu(memberSourceInfo.getShouru()));
        paramMap.put("profession",JiKeApisUtil.getjob(memberSourceInfo.getGongzuo()));
        paramMap.put("loanPurpose","1");
        paramMap.put("creditCardLimit",JiKeApisUtil.getXinYongKa(memberSourceInfo.getXinyongka()));
        paramMap.put("providentFund",JiKeApisUtil.getGjj(memberSourceInfo.getGjj()));
        paramMap.put("zhiMaScore",JiKeApisUtil.getZhimaScore(memberSourceInfo.getZhima()));
        paramMap.put("fromIp", memberSourceInfo.getReqIp());

        //加密
        String encrypt =  JiKeApisUtil.encryptAes(JSON.toJSONString(paramMap),pushApiKeyParam.getApiSecret());

        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String timestamp = memberSourceInfo.getCreateTime().format(fmt);
        Map<String, Object> bizMap = new HashMap<>();
        bizMap.put("reqId", UUID.randomUUID().toString().replaceAll("-", ""));
        bizMap.put("timestamp", timestamp);
        bizMap.put("channelCode",pushApiKeyParam.getApiCode());
        bizMap.put("data",encrypt);

        String  checkUrl = pushApiKeyParam.getCheckUrl();

        log.info("【吉客全流程导量】 撞库开始【infoId】{}【infoName】{}【queryUrl】{}【paramMap】{}【bizMap】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), checkUrl, JSON.toJSONString(paramMap), JSON.toJSONString(bizMap));
        String result = HttpUtil.createPost(checkUrl)
                .header("Content-Type", "application/json")
                .body(JSON.toJSONString(bizMap))
                .execute().body();
        log.info("【吉客全流程导量】撞库结束【infoId】{}【infoName】{}【result】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), result);

        JSONObject resultObject = JSON.parseObject(result);
        Integer respCode = resultObject.getInteger("code");
        String respMsg = resultObject.getString("message");

        pushApiResult.setCode(respCode+"");
        pushApiResult.setMessage(respMsg);
        pushApiResult.setParamInfo(JSON.toJSONString(paramMap));
        pushApiResult.setResultInfo(result);

        if (!StrUtil.equals(respCode.toString(), "0")) {
            pushApiResult.setPushSuccess(false);
            return pushApiResult;
        }

        // 撞库成功之后，商户的机构数据存储
        JSONObject data1 = resultObject.getJSONObject("data");
        Integer status = data1.getInteger("dealStatus");
        if(status == 1) {
            JSONArray phoneMd5List = data1.getJSONArray("phoneMd5List");
            if (MobileMd5IsInListUtils.isMobileMd5InList(phoneMd5List, memberSourceInfo.getMobileMd5())) {
                // 存在
                pushApiResult.setCode(respCode + "|" + "500");
                pushApiResult.setMessage(respMsg + "|" + memberSourceInfo.getMobileMd5() + "号码已存在");
                pushApiResult.setPushSuccess(false);
                return pushApiResult;
            }
            JSONArray orgInfoList = data1.getJSONArray("orgInfoList");
            JSONObject data = orgInfoList.getJSONObject(0);
            String checkNo = data1.getString("checkNo");
            String productName = data.getString("productName");
            String loanName = data.getString("orgName");
            String orgLogo = data.getString("orgLogo");
            String orgId = data.getString("orgId");
            // 撞库成功之后，商户的机构数据存储
            ThirdInfoDTO thirdInfoDTO = new ThirdInfoDTO();
            thirdInfoDTO.setInfoId(Integer.valueOf(pushApiKeyParam.getInfoId()));
            thirdInfoDTO.setInfoName(pushApiKeyParam.getInfoName());
            thirdInfoDTO.setOrderNo(orderNo);
            JSONObject infoObject = new JSONObject();
            infoObject.put("productName", productName);
            infoObject.put("orderNo", checkNo);
            infoObject.put("productId", orgId);
            infoObject.put("companyName", loanName);
            infoObject.put("companyLogo", orgLogo);
            infoObject.put("maxLoanAmount", "200000");
            infoObject.put("maxLoanRate", "20");
            infoObject.put("minLoanRate", "1");
            infoObject.put("businessInfo", pushApiKeyParam.getInfoName());
            JSONArray jsonArray = new JSONArray();
            JSONArray agreementList = data1.getJSONArray("agreementList");
            for (int i = 0; i < agreementList.size(); i++) {
                JSONObject jsonObject = new JSONObject();
                String agreemenName = agreementList.getJSONObject(i).getString("agreementName");
                String agreemenUrl = agreementList.getJSONObject(i).getString("agreementUrl");
                jsonObject.put("protocalName", agreemenName);
                jsonObject.put("protocalUrl", agreemenUrl);
                jsonArray.add(jsonObject);
            }
            infoObject.put("protocalList", jsonArray);
            thirdInfoDTO.setInfoObject(infoObject);

            //进行分润操作
            String priceType = pushApiKeyParam.getPriceType();
            BigDecimal typeRate = pushApiKeyParam.getTypeRate();
            if (ProfitSharingEnum.PROFITPRICE.getValue().equals(priceType)) {
                BigDecimal price = data1.getBigDecimal("price");//下游返回分润前价格
                if (price == null || price.compareTo(new BigDecimal(0.00)) == -1) {
                    pushApiResult.setPushSuccess(false);
                    return pushApiResult;
                }
                BigDecimal priceRight = typeRate.multiply(price);//分润后价格
                pushApiResult.setPrice(price);
                pushApiResult.setPriceRight(priceRight);

            }


            boolean save = merchantThirdBaseInfoService.saveThirdInfo(thirdInfoDTO);
            if (save) {
                pushApiResult.setPushSuccess(true);
                extJson.put("checkNo",checkNo);
                extJson.put("orgId",orgId);
            } else {
                pushApiResult.setMessage("保存撞库数据失败");
            }
        }

        return pushApiResult;
    }

    @Override
    public PushApiResult queryApprove(String orderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {
        PushApiResult pushApiResult = new PushApiResult();
        return pushApiResult;
    }

    @Override
    public PushApiResult registerUser(String orderNo, String outOrderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) {
        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);

        Map<String, Object> paramMap = new HashMap<>();
        String checkNo = extJson.getString("checkNo");
        String orgId = extJson.getString("orgId");
        JSONArray objects = new JSONArray();
        objects.add(orgId);
        paramMap.put("phone", memberSourceInfo.getMobile());
        paramMap.put("checkNo", checkNo);
        paramMap.put("orgIdList", objects);
        paramMap.put("name", memberSourceInfo.getRealname());
        if (memberSourceInfo.getSex() == 1){
            paramMap.put("sex", 1);
        }else {
            paramMap.put("sex", 0);
        }
        paramMap.put("age",memberSourceInfo.getAge());
        paramMap.put("cityName",memberSourceInfo.getCity());
        paramMap.put("loanAmount", JiKeApisUtil.getloan(memberSourceInfo.getLoanAmount()));
        paramMap.put("loanTerm", JiKeApisUtil.getLoanTime(memberSourceInfo.getLoanTime()));
        paramMap.put("salaryType", "2");
        paramMap.put("socialSecurity",JiKeApisUtil.getSocialInsurance(memberSourceInfo.getShebao()));
        paramMap.put("estate",JiKeApisUtil.getHouse(memberSourceInfo.getHouse()));
        paramMap.put("lifeInsurance",JiKeApisUtil.getbaodan(memberSourceInfo.getBaoxian()));
        paramMap.put("degree",JiKeApisUtil.getXueli(memberSourceInfo.getXueli()));
        paramMap.put("car",JiKeApisUtil.getCar(memberSourceInfo.getCar()));
        paramMap.put("monthIncome",JiKeApisUtil.getShouRu(memberSourceInfo.getShouru()));
        paramMap.put("profession",JiKeApisUtil.getjob(memberSourceInfo.getGongzuo()));
        paramMap.put("loanPurpose","1");
        paramMap.put("creditCardLimit",JiKeApisUtil.getXinYongKa(memberSourceInfo.getXinyongka()));
        paramMap.put("providentFund",JiKeApisUtil.getGjj(memberSourceInfo.getGjj()));
        paramMap.put("zhiMaScore",JiKeApisUtil.getZhimaScore(memberSourceInfo.getZhima()));
        paramMap.put("fromIp", memberSourceInfo.getReqIp());
        JSONArray authList = new JSONArray();

        ApplicationInfo appInfoByAppCode = applicationInfoService.getAppInfoByAppCode(memberSourceInfo.getAppCode());
        String protocolUrl = StrUtil.format("{}/page/JiKe/{}.html", appInfoByAppCode.getApiUrl(), memberSourceInfo.getUid());
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("accessoryUrl",protocolUrl);
        jsonObject.put("accessoryType","ACCREDIT");
        jsonObject.put("accessoryFileType","HTML");
        authList.add(jsonObject);
        paramMap.put("accessoryList", authList);
        //加密
        String encrypt =  JiKeApisUtil.encryptAes(JSON.toJSONString(paramMap),pushApiKeyParam.getApiSecret());

        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String timestamp = memberSourceInfo.getCreateTime().format(fmt);
        Map<String, Object> bizMap = new HashMap<>();
        bizMap.put("reqId", UUID.randomUUID().toString().replaceAll("-", ""));
        bizMap.put("timestamp", timestamp);
        bizMap.put("channelCode",pushApiKeyParam.getApiCode());
        bizMap.put("data",encrypt);

        String  registerUrl = pushApiKeyParam.getRegisterUrl();

        log.info("【吉克全流程导量】 进件开始【infoId】{}【infoName】{}【registerUrl】{}【paramMap】{}【bizMap】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), registerUrl, JSON.toJSONString(paramMap), JSON.toJSONString(bizMap));
        String result = HttpUtil.createPost(registerUrl)
                .header("Content-Type", "application/json")
                .body(JSON.toJSONString(bizMap))
                .execute().body();
        log.info("【吉克全流程导量】进件结束【infoId】{}【infoName】{}【result】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), result);
        JSONObject resultObject = JSON.parseObject(result);
        Integer respCode = resultObject.getInteger("code");
        String respMsg = resultObject.getString("message");

        pushApiResult.setCode(respCode+"");
        pushApiResult.setMessage(respMsg);
        pushApiResult.setParamInfo(JSON.toJSONString(bizMap));
        pushApiResult.setResultInfo(result);

        ThirdInfoDTO thirdInfoDTO = new ThirdInfoDTO();
        thirdInfoDTO.setOrderNo(orderNo );
        thirdInfoDTO.setRetCode(respCode+"");
        thirdInfoDTO.setRetMsg(respMsg);
        thirdInfoDTO.setResultInfo(result);
        thirdInfoDTO.setStatus("FAILED");

        if (StrUtil.equals(String.valueOf(respCode), "0")) {
            JSONObject respData = resultObject.getJSONObject("data");
            String status = respData.getString("dealStatus");
            String message = respData.getString("dealDesc");
            thirdInfoDTO.setRetCode(respCode+"|"+status );
            thirdInfoDTO.setRetMsg(respMsg+"|"+message);
            if(StrUtil.equals(status, "1")){
                thirdInfoDTO.setStatus("SUCCESS");
            }
        }
        merchantThirdBaseInfoService.updateThirdInfo(thirdInfoDTO);

        if (StrUtil.equals(String.valueOf(respCode), "0")) {
             pushApiResult.setPushSuccess(true);
             pushApiResult.setSettleFlag(true);
             pushApiResult.setStatus(PushStatusEnum.SUCCESS.getValue());
             return pushApiResult;
        }
        pushApiResult.setPushSuccess(false);
        pushApiResult.setSettleFlag(false);
        pushApiResult.setStatus(PushStatusEnum.FAILED.getValue());
        return pushApiResult;
    }

    @Override
    public PushApiResult queryResult(PushQueryParam pushQueryParam, PushApiKeyParam pushApiKeyParam, String extJson) {
        PushApiResult pushApiResult = new PushApiResult();
        return pushApiResult;
    }

    @Override
    public NoticeParamDTO getNoticeResultParam(String infoId, Map<String, String[]> parameterMap, String paramContent) {
        NoticeParamDTO noticeParamDTO = new NoticeParamDTO();
        return noticeParamDTO;


    }

    @Override
    public JSONObject getNoticeResultReturn(Map<String, String[]> parameterMap, String paramContent, JSONObject extObject) {
        JSONObject jsonObject = new JSONObject();
        return jsonObject;
    }


    @Override
    public ProtocolParamResult getProtocolResult(MerchantBaseInfo merchantBaseInfo, MemberSourceInfo memberSourceInfo) {
        return null;
    }

    @Override
    public StarInfoResult handleStarInfo(MerchantBaseInfo merchantBaseInfo, Map<String, String[]> parameterMap, String paramContent) throws Exception {
        StarInfoResult starInfoResult = new StarInfoResult();
        return starInfoResult;
    }

    @Override
    public PushApiResult checkUserCode(String orderNo, PushApiKeyParam pushApiKeyParam, MemberSourceInfo memberSourceInfo, JSONObject extJson) throws Exception {
        PushApiResult pushApiResult = new PushApiResult();
        pushApiResult.setPushSuccess(false);
        Map<String, Object> paramMap = new HashMap<>();

        paramMap.put("phone", memberSourceInfo.getMobileMask());
        paramMap.put("nameMd5", SecureUtil.md5(memberSourceInfo.getRealname()));
        if (memberSourceInfo.getSex() == 1) {
            paramMap.put("sex", 1);
        } else {
            paramMap.put("sex", 0);
        }
        paramMap.put("age", memberSourceInfo.getAge());
        paramMap.put("cityName", memberSourceInfo.getCity());
        paramMap.put("loanAmount", JiKeApisUtil.getloan(memberSourceInfo.getLoanAmount()));
        paramMap.put("loanTerm", JiKeApisUtil.getLoanTime(memberSourceInfo.getLoanTime()));
        paramMap.put("salaryType", "2");
        paramMap.put("socialSecurity", JiKeApisUtil.getSocialInsurance(memberSourceInfo.getShebao()));
        paramMap.put("estate", JiKeApisUtil.getHouse(memberSourceInfo.getHouse()));
        paramMap.put("lifeInsurance", JiKeApisUtil.getbaodan(memberSourceInfo.getBaoxian()));
        paramMap.put("degree", JiKeApisUtil.getXueli(memberSourceInfo.getXueli()));
        paramMap.put("car", JiKeApisUtil.getCar(memberSourceInfo.getCar()));
        paramMap.put("monthIncome", JiKeApisUtil.getShouRu(memberSourceInfo.getShouru()));
        paramMap.put("profession", JiKeApisUtil.getjob(memberSourceInfo.getGongzuo()));
        paramMap.put("loanPurpose", "1");
        paramMap.put("creditCardLimit", JiKeApisUtil.getXinYongKa(memberSourceInfo.getXinyongka()));
        paramMap.put("providentFund", JiKeApisUtil.getGjj(memberSourceInfo.getGjj()));
        paramMap.put("zhiMaScore", JiKeApisUtil.getZhimaScore(memberSourceInfo.getZhima()));
        paramMap.put("fromIp", memberSourceInfo.getReqIp());

        //加密
        String encrypt = JiKeApisUtil.encryptAes(JSON.toJSONString(paramMap), pushApiKeyParam.getApiSecret());

        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String timestamp = memberSourceInfo.getCreateTime().format(fmt);
        Map<String, Object> bizMap = new HashMap<>();
        bizMap.put("reqId", UUID.randomUUID().toString().replaceAll("-", ""));
        bizMap.put("timestamp", timestamp);
        bizMap.put("channelCode", pushApiKeyParam.getApiCode());
        bizMap.put("data", encrypt);

        String checkUrl = pushApiKeyParam.getCheckUrl();

        log.info("【上游吉客全流程】 撞库开始【infoId】{}【infoName】{}【queryUrl】{}【paramMap】{}【bizMap】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), checkUrl, JSON.toJSONString(paramMap), JSON.toJSONString(bizMap));
        String result = HttpUtil.createPost(checkUrl)
                .header("Content-Type", "application/json")
                .body(JSON.toJSONString(bizMap))
                .execute().body();
        log.info("【上游吉客全流程】撞库结束【infoId】{}【infoName】{}【result】{}",
                pushApiKeyParam.getInfoId(), pushApiKeyParam.getInfoName(), result);

        JSONObject resultObject = JSON.parseObject(result);
        Integer respCode = resultObject.getInteger("code");
        String respMsg = resultObject.getString("message");

        pushApiResult.setCode(respCode + "");
        pushApiResult.setMessage(respMsg);
        pushApiResult.setParamInfo(JSON.toJSONString(paramMap));
        pushApiResult.setResultInfo(result);

        if (!StrUtil.equals(respCode.toString(), "0")) {
            pushApiResult.setPushSuccess(false);
            return pushApiResult;
        }

        // 撞库成功之后，商户的机构数据存储
        JSONObject data1 = resultObject.getJSONObject("data");
        Integer status = data1.getInteger("dealStatus");
        if (status == 1) {
            JSONArray phoneMd5List = data1.getJSONArray("phoneMd5List");
            pushApiResult.setMd5List(phoneMd5List);
            JSONArray orgInfoList = data1.getJSONArray("orgInfoList");
            JSONObject data = orgInfoList.getJSONObject(0);
            String checkNo = data1.getString("checkNo");
            String productName = data.getString("productName");
            String loanName = data.getString("orgName");
            String orgLogo = data.getString("orgLogo");
            String orgId = data.getString("orgId");
            // 撞库成功之后，商户的机构数据存储
            ThirdInfoDTO thirdInfoDTO = new ThirdInfoDTO();
            thirdInfoDTO.setInfoId(Integer.valueOf(pushApiKeyParam.getInfoId()));
            thirdInfoDTO.setInfoName(pushApiKeyParam.getInfoName());
            thirdInfoDTO.setOrderNo(orderNo);
            JSONObject infoObject = new JSONObject();
            infoObject.put("productName", productName);
            infoObject.put("orderNo", checkNo);
            infoObject.put("productId", orgId);
            infoObject.put("companyName", loanName);
            infoObject.put("companyLogo", orgLogo);
            infoObject.put("maxLoanAmount", "200000");
            infoObject.put("maxLoanRate", "20");
            infoObject.put("minLoanRate", "1");
            infoObject.put("businessInfo", pushApiKeyParam.getInfoName());
            JSONArray jsonArray = new JSONArray();
            JSONArray agreementList = data1.getJSONArray("agreementList");
            for (int i = 0; i < agreementList.size(); i++) {
                JSONObject jsonObject = new JSONObject();
                String agreemenName = agreementList.getJSONObject(i).getString("agreementName");
                String agreemenUrl = agreementList.getJSONObject(i).getString("agreementUrl");
                jsonObject.put("protocalName", agreemenName);
                jsonObject.put("protocalUrl", agreemenUrl);
                jsonArray.add(jsonObject);
            }
            infoObject.put("protocalList", jsonArray);
            thirdInfoDTO.setInfoObject(infoObject);

            //进行分润操作
            String priceType = pushApiKeyParam.getPriceType();
            BigDecimal typeRate = pushApiKeyParam.getTypeRate();
            if (ProfitSharingEnum.PROFITPRICE.getValue().equals(priceType)) {
                BigDecimal price = data1.getBigDecimal("price");//下游返回分润前价格
                if (price == null || price.compareTo(new BigDecimal(0.00)) == -1) {
                    pushApiResult.setPushSuccess(false);
                    return pushApiResult;
                }
                BigDecimal priceRight = typeRate.multiply(price);//分润后价格
                pushApiResult.setPrice(price);
                pushApiResult.setPriceRight(priceRight);

            }


            boolean save = merchantThirdBaseInfoService.saveThirdInfo(thirdInfoDTO);
            if (save) {
                pushApiResult.setPushSuccess(true);
                extJson.put("checkNo", checkNo);
                extJson.put("orgId", orgId);
            } else {
                pushApiResult.setMessage("保存撞库数据失败");
            }
        }

        return pushApiResult;
    }

}
